namespace SolidMvvmLite {
	using System;
	using System.Diagnostics;

	public abstract class ViewModelBase : PropertyChangedNotifier, IDisposable {
		protected ViewModelBase(IMessageReporter messageReporter) {
			MessageReporter = messageReporter;
		}

		public IMessageReporter MessageReporter { get; private set; }

		public virtual void Dispose() {
			GC.SuppressFinalize(this);
			MessageReporter = null;
		}

#if DEBUG
		~ViewModelBase() {
			var lookAtThisTypeThatWasNotDisposed = GetType();
			Debugger.Break(); // Oops. Something wasn't disposed.
			Console.WriteLine("NOT DISPOSED: " + lookAtThisTypeThatWasNotDisposed);
		}
#endif
	}
}
